package pk1;


import javax.jdo.PersistenceManager;
import javax.jdo.Query;
import javax.jdo.annotations.*;

import shared.PMF;

//import javax.jdo.PersistenceManager;
//import javax.jdo.Query;

//import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
//import java.util.List;
//import shared.PMF;
import java.util.List;


@PersistenceCapable
public class Record{
	
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Long id;
    
    @Persistent
    private String inviterd_ID;
	@Persistent
    private String inviter_ID;
	@Persistent
    private String invite_activity;
	@Persistent
    private String inviterd_con;
    @Persistent
    private String inviter_con;
	@Persistent
    private Date invite_date;
	@Persistent
    private String invite_message;
	@Persistent
    private String status;
	   
	

	public Record(String inviterd_ID, String inviter_ID,String invite_activity,String inviterd_con,String inviter_con,Date invite_date, String invite_message, String status){
			this.inviterd_ID = inviterd_ID;
			this.inviter_ID = inviter_ID;
			this.invite_activity = invite_activity;
			this.inviterd_con = inviterd_con;
			this.inviter_con = inviter_con;
            this.invite_date = invite_date;
            this.invite_message = invite_message;
            if(status!=" "){
            	this.status = status;
            }else{
            	this.status = "UnConfirm";
            }
        }
        public Record(){
        	this.inviterd_ID = "N/A";
            this.inviter_ID = "N/A";
            this.invite_activity = "N/A";
			this.inviterd_con = "N/A";
			this.inviter_con = "N/A";
            Calendar calendar = Calendar.getInstance(); 
            this.invite_date = calendar.getTime();
            this.invite_message = "N/A";
            this.status = "UnConfirm";
        }
        
        public Long getID(){
            return id;
        }

        public Date getInviteDate(){
            return invite_date;
        }
        public String getInviteMessage(){
            return invite_message;
        }
        public String getInviteActivity(){
            return invite_activity;
        }
        public String getInviterCon(){
            return inviter_con;
        }
        public String getInviterdCon(){
            return inviterd_con;
        }
        public String getInviterdID(){
            return inviterd_ID;
        }
        public String getInviterID(){
            return inviter_ID;
        }
        public String getStatus(){
            return status;
        }
        public boolean checkRecord(String someName){
        	boolean flag = false;
          			if(inviterd_ID.equals(someName)){
          				flag = true;
          			} 				
            return flag;                  		
     	}
        
} // Product
